<?php
include '../../init.php';

include DIR_CORE.'mysql.php';
$title = '沐水莲心-编辑填空题';

//接收要编辑题目信息
//var_dump($_POST);

$id = $_POST['id'];
$type_id = s($_POST['type']);
$question = s($_POST['question']);
$a = s($_POST['answer']);
$answer = $a;
$time = time();

$sql = "update fill set type_id = '$type_id',question = '$question',answer='$answer',create_time='$time' where id = '$id'";
//echo $sql;

$res = mysqli_query($link, $sql);
if ($res) {
    echo '<h2 style="color:green;font-weight:bold;">更新成功</h2>';
} else {
    echo '<h2 style="color:red;font-weight:red;">更新失败</h2>';
}
